<div class="col-md-12">
	<div class="panel panel-primary">
		<div class="panel-heading">
		  <h3 class="panel-title">Quản lý tin tuyển dụng</h3>
		</div>
		<div class="panel-body">
			<div class="col-md-8 col-sm-8">
				<?php if($info = $this->session->flashdata('info')):?>
				<?php echo '<div class="alert alert-info"><strong>'.$info.'</strong></div>';?>
				<?php endif;?>				
			</div>
			<div class="col-md-4 text-right col-sm-4">
				<a class="btn btn-default" href="<?=site_url('tai-khoan')?>" title="Quay lại">Quay lại</a>
				<a class="btn btn-primary" href="<?=site_url('tuyen-dung/quan-ly-tin/them')?>">Thêm tin</a>
			</div>
			<p>&nbsp;</p>
			<script type="text/javascript">
				function confirm_xoa(href, event){
					if(confirm('Bạn chắc chắn muốn xóa?'))
						location.href = href;
					event.preventDefault;
					return false;
				}
			</script>
			<table class="table table-dashed" width="100%">
				<thead>
					<th width="50px">Mã tin</th>
					<th >Tiêu đề</th>
					<th width="130px">Địa điểm</th>
					<th width="80px">Ngày đăng</th>
					<th width="90px">Hạn nộp HS</th>
					<th width="90px" >Trạng thái</th>
					<th width="120px" class="text-center"></th>
				</thead>
				<tbody>
				<?php $status = array('Chờ duyệt', 'Đã duyệt', 'Khóa');
					foreach($tin as $obj):
					$cls = 'class="';
					if($obj->vip) $cls .= "vip ";
					if($obj->hot) $cls .= "hot ";
					$cls .='"';
				?>
					<tr <?=$cls?>>
						<td><?=$obj->code?></td>
						<td><?=$obj->tieu_de?></td>
						<td><?=$obj->dia_diem?></td>
						<td><?=date('d/m/Y', strtotime($obj->ngay_dang))?></td>
						<td><?=$obj->han_hoso?></td>
						<td><?=$status[$obj->trang_thai]?></td>
						<td>
							<a class="btn btn-primary" href="<?=site_url('tuyen-dung/quan-ly-tin/sua/'.$obj->id)?>" title="Sửa tin này">Sửa</a>
							<a class="btn btn-danger" onclick="confirm_xoa('<?=site_url('tuyen-dung/quan-ly-tin/xoa/'.$obj->id)?>',event);" title="Xóa tin này">Xóa</a>
						</td>
					</tr>	
				<?php endforeach;?>
				</tbody>
			</table>
		</div>
	</div>
</div>